/*
 * face.hpp
 *
 *  Created on: 16/11/2011
 *      Author: Aeradon
 */

#ifndef FACE_HPP_
#define FACE_HPP_

#include <set>
#include <vector>
#include "vertex.hpp"
#include "symedge.hpp"
#include "triangulation.hpp"
#include "navinode.hpp"
#include "point.hpp"

class SymEdge;
class Vertex;
class Edge;
class NaviNode;

//#ifdef _BUILD_DLL
//   #define DLLDIR  __declspec(dllexport)   // export DLL information
//#else
//   #define DLLDIR  __declspec(dllimport)   // import DLL information
//#endif
//
//class DLLDIR Face
class Face
{
public:
	typedef Vertex   V;
	typedef Edge     E;
	typedef SymEdge  S;
	typedef Face	 F;
	typedef float    T;
	typedef NaviNode N;
	typedef Point<T> P;

	static const int MAX_EDGES = 4;

public:
	/// XXX Construtor zuado
	Face();
	virtual ~Face();

	void setEdges(S* e1, S* e2, S* e3);
	void setEdges(const std::vector<S*>& symEdges);

	inline int getEdgeCount() const { return v_edge.size(); }
	inline S* getEdge(int i) const { return v_edge[i]; }

	bool IsMarked();
	void ResetMark();
	void Mark();

	bool colidesWithCircle(P point, T radius);
	void FindEdgesColidingWithCircle(P point, T radius, std::set<SymEdge*>& s_edges);

	unsigned int vecIndex;
	int mark;
	bool isBoundary;

	N* node;

private:
	  /** stores the adjacent half edges in ccw order */
	  std::vector<S*> v_edge;

	  static int markCount;
};

#endif /* FACE_HPP_ */
